# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppInfo do
  @moduledoc """
  Chrome Web Store app information.

  ## Attributes

  *   `googleOwned` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the app or extension is built and maintained by Google. Version-specific field that will only be set when the requested app version is found.
  *   `isCwsHosted` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the app or extension is in a published state in the Chrome Web Store.
  *   `isExtensionPolicySupported` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether an app supports policy for extensions.
  *   `isKioskOnly` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the app is only for Kiosk mode on ChromeOS devices
  *   `isTheme` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the app or extension is a theme.
  *   `kioskEnabled` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether this app is enabled for Kiosk mode on ChromeOS devices
  *   `minUserCount` (*type:* `integer()`, *default:* `nil`) - Output only. The minimum number of users using this app.
  *   `permissions` (*type:* `list(GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppPermission.t)`, *default:* `nil`) - Output only. Every custom permission requested by the app. Version-specific field that will only be set when the requested app version is found.
  *   `siteAccess` (*type:* `list(GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppSiteAccess.t)`, *default:* `nil`) - Output only. Every permission giving access to domains or broad host patterns. ( e.g. www.google.com). This includes the matches from content scripts as well as hosts in the permissions node of the manifest. Version-specific field that will only be set when the requested app version is found.
  *   `supportEnabled` (*type:* `boolean()`, *default:* `nil`) - Output only. The app developer has enabled support for their app. Version-specific field that will only be set when the requested app version is found.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Output only. Types of an item in the Chrome Web Store
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :googleOwned => boolean() | nil,
          :isCwsHosted => boolean() | nil,
          :isExtensionPolicySupported => boolean() | nil,
          :isKioskOnly => boolean() | nil,
          :isTheme => boolean() | nil,
          :kioskEnabled => boolean() | nil,
          :minUserCount => integer() | nil,
          :permissions =>
            list(
              GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppPermission.t()
            )
            | nil,
          :siteAccess =>
            list(
              GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppSiteAccess.t()
            )
            | nil,
          :supportEnabled => boolean() | nil,
          :type => String.t() | nil
        }

  field(:googleOwned)
  field(:isCwsHosted)
  field(:isExtensionPolicySupported)
  field(:isKioskOnly)
  field(:isTheme)
  field(:kioskEnabled)
  field(:minUserCount)

  field(:permissions,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppPermission,
    type: :list
  )

  field(:siteAccess,
    as: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppSiteAccess,
    type: :list
  )

  field(:supportEnabled)
  field(:type)
end

defimpl Poison.Decoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppInfo do
  def decode(value, options) do
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppInfo.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1ChromeAppInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
